import config
from api.ihrm_login_api import IHRMLoginAPL
from common.assert_util import AssertUtil
from common.read_config_util import ReadConfigUtil
from parameterized import parameterized


class TestIHRMLogin:
    ihrm_login_file_path = config.BASE_DIR + "/data/data.json"

    # 登录成功
    @parameterized.expand(ReadConfigUtil.read_data(ihrm_login_file_path))
    def test_login(self, body, status_code, success, code, message):
        resp = IHRMLoginAPL.login_api(body)
        AssertUtil.ihrm_assert(resp, status_code, success, code, message)
